#ifndef LINECHARTSWIDGET_H
#define LINECHARTSWIDGET_H

#include <QWidget>
#include <QPushButton>
#include <QTimer>
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <QtCharts/QValueAxis>
#include <QScatterSeries>
#include <QtCharts/QCategoryAxis>
#include <QVBoxLayout>
#include <QHBoxLayout>

class LineChartsWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LineChartsWidget(QWidget *parent = nullptr);

    int iCount = 0;

    void DrawGridDiagram();

    void DrawGridDiagramBack();
    void DrawGridDiagramInit();
    void DrawGridDiagramTest();

    // void paintEvent(QPaintEvent *event) override;

private:
    QLineSeries *series;
    QScatterSeries *scatterSeries;
    QChart *chart;
    QChartView *chartView;
    QList<QPointF> listData;
    QTimer *timer;
    int currentIndex = 0;
    void addNextPoint();
    void SetupChart();
    void UpdateChart();

public slots:
    // 定义一个槽函数，参数类型和信号的参数类型匹配，用于处理信号
    // void DrawGridDiagramPro(QLineSeries &series);

signals:

};

#endif // LINECHARTSWIDGET_H
